Add error handling for badly formatted label
Fix errors in early commit