Minor formatting and exception handling tweaks