Fixed capitalization bugs, added tests