Bug fixes galore

Fixed a few minor bugs, such as replacing cards and inverted inside/outside.