Some other bug fixes