minor bug fix
minor bug fixes and resolved merge conflicts