Added safe upper/lower case string conversion functions.