Add verbose error logging + fix string formatting bugs