With the help of a good friend, learnt about and implemented a copy and move constructors and operators, fixing many issues.