More fixes on the source, corrections for ios