Modified dump_memory function to not get drowned out by previous lines where there may not be a newline, added cast(not sure if required).