Attempted bug fixes