some code fixes