This commit improves Exception handling, and made some changes to
try/catch blocks, where the `KeyError` is now explicitly caught. If in
the future, we have reports of other Exceptions being caught, we can
include those in the handling.
For now, I've used BaseException for two try/catch blocks. I need to
check what exceptions can happen there.
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>