fixes a couple of edge case bugs discovered after submission