Merging
Fixed somewhat on the weird bug. Might need more testing.