Unsuccessful attempt at fixing a few bugs