Some fixes

Fixed some Kohana issues