minor bug fixes to get it running