Fixed camera focus bug and increased robustness in case of error