Fixed wrong behaviour when string was empty and allowsEmpty was set to YES.