Fixing up minor bugs