minor bug fixes, change style to be more flexible on multi-environment setups