manual fix changes from skullplate for  312-319

There were some errors in the committed code that created conflicts. I fixed the errors and applied the commits.