Attempts at bug fixing