patch to apply when compiling for 10/12 bit by Andrew