Fixed based on Greg's code review comments