trailing whitespace; unnecessary cast; changed error format