fixed bugs to make project kind of stable again.