missing ;
cleanup and some small bug fixes