Improved handling of boolean and object dict