Fixes for #61,#60,#59,#58,#57