bug fixes; deal with situations with empty string