Just a few bug fixes