Fixed a few issues related to card manipulation