Remove Dead Stores and memory warnings