Bug fixes. This commit is very buggy. Shouldn't be used daily.