minor bug fixes after merging code