Fix some bugs in the STS

There are a couple of issues in here that are harming my freedom, I've now rectified them.