fixing some type issues around records
Adding test case, removing debug stuff