The lat/lon offset values should be interpreted as spherical rotation angles instead of simple angle additions and the new lat/lon values computed accordingly so that they do not lead to erroneous angles being output.