Updates to the source and fixing some stuff