Added btypes.h + a few cleanups