Change initialisation order to ensure that consistency exceptions are not thrown

This also fixes compatibility with iOS8