Fix bugs and add tests for variant parsing

The following cases are now handled properly:
- "false" (yeah, really)
- integers in octal / hexadecimal format
- empty dictionaries with inferred type information