Improve fps=0 and exception handling