Fixed working in 10.9 and all warnings