Fixed various ibatis issues