small changes to exceptions and what not
added test for bfactor code