fixed bug in machine#makeChange. Added new unit tests to confirm.