Bug fixes

Make a few lint and bug fixes.