Various fixes and improvements to test cases.
Test cases for properties API with some bug fixes.