Refactored some files; fixed descriptor/pipeline issues.