Repaired iOS bugs and refactored
Repaired a bug in the interface

Also made some refactor and repaired fatal error