Added isset() to some elements to stop warnings/errors