Fixed null pointer exception when re-initiating the same capture mode twice.

- Also optimised logic for capture modes.
- Small refactors & typo fixes.