Modified class MetaDataHandler.

Due to bugs found during testing, we added some extra if-statements in order not to return empty Strings.