Fixed compile time errors

Still need to decide if I should stick with using shared_ptr or not