Fixes for issues 2-5