Closed #1 and #3 in previous commits