Fix potential issues (thanks scrutinizer!)