Added further test cases.
Fixed bug allowing multiple fields to share an alias.