Added error-handling and allowing for missing inputs in abundance stage.