Issues #27 and #28 addressed in these changes