Fix #408: Reject invalid strings when parsing Double and Float