general fixes, bit of cleanup