Added unit test and made small modifications to the actual parser. Change-Id: I005340712ca2b17b7ca5a0517aa88f3cec7ee288