fix up from pull #44

last fixes from pull #44 thanks @WebBreacher