More tests related with parsing and some fixes to bugs detected by these tests;