fixed a few bugs discovered by moving refactorings to azure