Fixes based on JD's code review