Fixed compiler warnings, removed type mismatch