Test updates and fixes

The commit comments should speak for themselves, but please don't hesitate to request further clarification if necessary.