Miscellaneous bug fixes
moved