added a bit more robustness to safeForward and safeBack, fixes #37, hopefully