Fix for empty packages fix, thanks to @jmchilton