bug fixes after unsuccessfull merge