better handling of invalid paste ids

also makes error message formatting more consistent