Reposting z502 code in case of error, plus timer changes