Added name-detection.
Better error-handling.