[FIX] Some outstanding bug fixes