Fixing tabbing errors and adding empty checks.