fixes to multiple issues