Add input data checks and guards