Getting ready for api docs...
fix minor bugs.