- fixed a number of bugs