Implemented mkrautz's suggestions.